const fs = require("fs");
const path = require("path");

const text = "hello, write";
const filePath = path.join(__dirname, "./test.txt");
fs.writeFile(filePath, text, function (err) {
  if (err) {
    console.log(err);
  } else {
    console.log("write sucess");
    const data = fs.readFileSync(filePath, "utf-8");
    console.log("read", data);
  }
});
